import 'package:flutter/material.dart';

class NewsService {

  static Widget getNews(BuildContext context, int type, int index) {
    List<Widget> list1 = [
      new Card(
        margin: const EdgeInsets.all(2.0),
        child: new ListTile(
            title: new Text('北京市复兴路10号',
                style: new TextStyle(fontWeight: FontWeight.w500)),
            subtitle: new Text('北京市，100844'),
            leading: new Icon(
              Icons.business,
              color: Colors.blue[500],
            )
        ),),
      new Card(margin: const EdgeInsets.all(2.0), child: new ListTile(
          title: new Text('北京市复兴路13号',
              style: new TextStyle(fontWeight: FontWeight.w500)),
          subtitle: new Text('北京市，100844'),
          leading: new Icon(
            Icons.business,
            color: Colors.blue[500],
          )
      ),),
    ];
    List<Widget> list2 = [
      new Card(
        margin: const EdgeInsets.all(2.0),
        child: new ListTile(
            title: new Text('南京市中华路10号',
                style: new TextStyle(fontWeight: FontWeight.w500)),
            subtitle: new Text('南京市，100844'),
            leading: new Icon(
              Icons.business,
              color: Colors.blue[500],
            )
        ),),
      new Card(margin: const EdgeInsets.all(2.0), child: new ListTile(
          title: new Text('南京市中华路11号',
              style: new TextStyle(fontWeight: FontWeight.w500)),
          subtitle: new Text('南京市，100844'),
          leading: new Icon(
            Icons.business,
            color: Colors.blue[500],
          )
      ),),
    ];
    if (type == 1) {
      return list1[index];
    } else {
      return list2[index];
    }
  }

}